import * as echarts from 'echarts';

const GetListOption = (ListXData,ListSeries) => {
  return {
    xAxis: {
      data: ListXData,
      axisTick:{
        "show":false
      }
    },
    yAxis: {
      show: false
    },
    grid: {  // 布满div
      top:"20px",
      left:"20px",
      right:"20px",
      bottom:"30px"
    },
    tooltip: { // 鼠标悬浮提示框显示 X和Y 轴数据
      // trigger: 'axis',
      backgroundColor: 'rgba(32, 33, 36,.7)',
      borderColor: 'rgba(32, 33, 36,0.20)',
      borderWidth: 1,
      textStyle: { // 文字提示样式
        color: '#fff',
        fontSize: '12'
      },
    },
    series: [
      {
        type: 'bar',
        data: ListSeries,
        barWidth:'60%',
        itemStyle: {
          normal: {
            color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
              {
                offset: 1,
                color: '#7905d8'
              },
              {
                offset: 0,
                color: '#ca00d0'
              }
            ]),
          }
        }
      }
    ]
  };
}

export default GetListOption